#!/usr/bin/perl

use 5.010;
use strict;
use warnings;

my $str = "The black cat climbed the green tree";
#          012345678901234567890123456789001234

say substr $str, 4, 5;    ## black

say substr $str, 4, -11;  ## black cat climbed the

say substr $str, 14;      ## climbed the green tree

say substr $str, -4;      ## tree

say substr $str, -4, 2;   ## tr

my $z = substr $str, 14, 7, "jumped from";

say $z;     ## climbed
say $str;   ## The black cat jumped from the green tree
